Socket
Socket
Sign inDemoInstall

yocto-queue

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yocto-queue

Tiny queue data structure


Version published
Weekly downloads
50M
increased by6.34%
Maintainers
0
Weekly downloads
 
Created

What is yocto-queue?

The yocto-queue npm package is a minimalistic queue with an array-like interface. It is designed to be a tiny, performant FIFO (First In, First Out) queue implementation for managing a list of items in a sequential order.

What are yocto-queue's main functionalities?

Enqueue

Adds elements to the end of the queue.

const Queue = require('yocto-queue');
const queue = new Queue();
queue.enqueue('unicorn');
queue.enqueue('rainbow');

Dequeue

Removes and returns the first element from the queue.

const Queue = require('yocto-queue');
const queue = new Queue();
queue.enqueue('unicorn');
queue.enqueue('rainbow');
const firstItem = queue.dequeue();

Clear

Clears the queue.

const Queue = require('yocto-queue');
const queue = new Queue();
queue.enqueue('unicorn');
queue.enqueue('rainbow');
queue.clear();

Size

Returns the number of elements in the queue.

const Queue = require('yocto-queue');
const queue = new Queue();
queue.enqueue('unicorn');
queue.enqueue('rainbow');
const size = queue.size;

Peek

Returns the first element in the queue without removing it.

const Queue = require('yocto-queue');
const queue = new Queue();
queue.enqueue('unicorn');
queue.enqueue('rainbow');
const firstItem = queue.peek();

Other packages similar to yocto-queue

Keywords

FAQs

Package last updated on 29 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc